package com.pvdnc.tapkit.chat.chat.server;

import com.pvdnc.nsocket.server.ClientManager;
import com.pvdnc.nsocket.server.handler.SimpleServerHandler;
import com.pvdnc.tapkit.chat.chat.ChatServer;
import com.pvdnc.tapkit.chat.chat.packet.ClientClose;

import io.netty.channel.ChannelHandlerContext;

public class OnClientClose extends SimpleServerHandler<ChatServer, ClientClose> {
    public OnClientClose(ChatServer server) {
        super(server, ClientClose.COMMAND);
    }

    @Override
    public void onReceived(ChannelHandlerContext ctx, ClientClose msg) {
        ClientManager.getInstance().removeClient(msg.mName);
    }
}
